//
//  DEWNoticeModel.m
//  OtherDemo
//
//  Created by lianjie on 2018/7/29.
//  Copyright © 2018年 lianjie. All rights reserved.
//

#import "DEWNoticeModel.h"

@implementation DEWNoticeModel


-(NSAttributedString *)attbuteText
{
    NSString *descStr = self.text;
    
    NSMutableAttributedString *attribute = [[NSMutableAttributedString alloc]initWithString:descStr];
    
    [attribute setAttributes:@{NSFontAttributeName:[UIFont fontWithName:@"Heiti SC" size:13],NSForegroundColorAttributeName:UIColorFromRGB(0x666666)} range:NSMakeRange(0, descStr.length)];
    
    return attribute;
}

-(CGFloat)cellHeight
{
    CGFloat cHeight = 127.0f;
    
    CGSize attSize = [self.attbuteText boundingRectWithSize:CGSizeMake(DEWScreenWidth-Margin_15*3-90, MAXFLOAT) options:NSStringDrawingUsesLineFragmentOrigin context:nil].size;
    
    if ([self.type isEqualToString:@"15"] || [self.type isEqualToString:@"21"]) {
        
        cHeight = attSize.height+52+30+40+45;
        
    }else{
        
        if (attSize.height>35) {
            cHeight = attSize.height+52+40;
        }else{
            cHeight = 127;
        }
    }
    return cHeight;
}


@end
